package com.xyht.medicine_management_system.modules.payment.wxpay.controller;

import com.wechat.pay.java.core.notification.RequestParam;
import com.xyht.medicine_management_system.common.annotation.RepeatRequestCheck;
import com.xyht.medicine_management_system.common.annotation.RequestPass;
import com.xyht.medicine_management_system.common.commonReturn.ResponseResult;
import com.xyht.medicine_management_system.modules.payment.wxpay.entity.CallbackBodyEntity;
import com.xyht.medicine_management_system.modules.payment.wxpay.service.WxService;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/wxpay")
public class WxController {
    @Resource
    private WxService wxService;

    @PostMapping("/payCallback")
    @ApiModelProperty("微信支付回调接口")
    @RequestPass
    public String wxPayCallback(@RequestBody CallbackBodyEntity entity, HttpServletRequest request, HttpServletResponse response) {
        return wxService.wxPayCallback(entity,request,response);
    }

}
